<!DOCTYPE html>
<html>

<head>
    <!-- <meta charset="utf-8"> -->
    <title>涨停表现</title>
</head>

<script type="text/javascript" src="./js/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="./js/jquery.tablesorter.min.js"></script>

<link type="text/css" rel="stylesheet" href="./css/fupan_css.css">
<link type="text/css" rel="stylesheet" href="./css/calendar.css">
<link type="text/css" rel="stylesheet" href="./kpl/com.css">
<link type="text/css" rel="stylesheet" href="./kpl/fChart.css">
<link type="text/css" rel="stylesheet" href="./kpl/mpage.css">

<script src="./js/update.js"></script>
<script src="./js/show_message.js"></script>

<script src="./js/kaipanla.js"></script>

<!-- <script src="./kpl/jquery.js"></script> -->
<script src="./kpl/com.js"></script>
<!--分时-->
<script src="./kpl/floatMChart.js"></script>
<!--K线-->
<script src="./kpl/floatKChart.js"></script>
<script src="./kpl/fChart.js"></script>

<body>
    <div id="table" class="table-one" style="float:right;width:220px;">
        <div style="position:fixed;">
            <div style="float:left;">
                <label for="meeting">选择日期：</label>
            </div>

            <div style="float:left;">
                <div class="to_left" onclick="οnclick_to_left()"></div>

            </div>
            <div style="float:left;">
                <input id="meeting" type="date" onchange="upperCase(this.id)" />
            </div>

            <div style="float:left;">
                <div class="to_right" onclick="οnclick_to_right()"></div>
            </div>
        </div>
        <div class="table-one" style="float:right;">
            <br>
            <a href="./个股涨幅.html">个股涨幅</a>
        </div>
    </div>
    <div class="table-one" style="float:left;width:100%;height:20px;"></div>
    <div class="table-one" style="float:left;width:100%;height:100%;">
        <div class="table-one" style="float:left;width:20%;height:100%;overflow:auto;">
            <div class="table-one" style="float:left;height:50%;overflow:auto;">
                <table id="limit-1" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">涨停时间</th>
                            <th style="width:28px">状态</th>
                            <th style="width:98px">涨停原因</th>
                            <th style="width:60px">成交额</th>
                        </tr>
                    </thead>
                    <tbody id="limit1"></tbody>
                </table>
            </div>
            <div class="table-one" style="float:left;height:50%;overflow:auto;">
                <table id="broke-now" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:40px">涨幅</th>
                            <th style="width:130px">板块</th>
                            <th style="width:60px">成交额</th>
                        </tr>
                    </thead>
                    <tbody id="broke"></tbody>
                </table>
            </div>
        </div>
        <!-- <div class="table-one" style="float:left;width:2px;height:100%;overflow:auto;"></div> -->
        <div class="table-one" style="float:left;width:20%;height:100%;">
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit-2" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">涨停时间</th>
                            <th style="width:28px">状态</th>
                            <th style="width:98px">涨停原因</th>
                            <th style="width:60px">成交额</th>
                        </tr>
                    </thead>
                    <tbody id="limit2"></tbody>
                </table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit-22" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">状态</th>
                            <th style="width:180px">板块</th>
                            <th style="width:40px">涨幅</th>
                        </tr>
                    </thead>
                    <tbody id="limit22"></tbody>
                </table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="broke-history-id" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:40px">涨幅</th>
                            <th style="width:160px">板块</th>
                            <th style="width:60px">成交额</th>
                            <th style="width:40px">实时</th>
                        </tr>
                    </thead>
                    <tbody id="broke-history"></tbody>
                </table>
            </div>
        </div>
        <!-- <div class="table-one" style="float:left;width:2px;height:100%;overflow:auto;"></div> -->
        <div class="table-one" style="float:left;width:20%;height:100%;">
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit-3" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">涨停时间</th>
                            <th style="width:28px">状态</th>
                            <th style="width:98px">涨停原因</th>
                            <th style="width:60px">成交额</th>
                        </tr>
                    </thead>
                    <tbody id="limit3"></tbody>
                </table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit-33" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">状态</th>
                            <th style="width:180px">板块</th>
                            <th style="width:40px">涨幅</th>
                        </tr>
                    </thead>
                    <tbody id="limit33"></tbody>
                </table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="history-33" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">状态</th>
                            <th style="width:180x">板块</th>
                            <th style="width:40px">昨日</th>
                            <th style="width:40px">实时</th>
                        </tr>
                    </thead>
                    <tbody id="history33"></tbody>
                </table>
            </div>
        </div>
        <!-- <div class="table-one" style="float:left;width:2px;height:100%;overflow:auto;"></div> -->
        <div class="table-one" style="float:left;width:20%;height:100%;">
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit-4" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">涨停时间</th>
                            <th style="width:28px">状态</th>
                            <th style="width:98px">涨停原因</th>
                            <th style="width:60px">成交额</th>
                        </tr>
                    </thead>
                    <tbody id="limit4"></tbody>
                </table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit-44" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">状态</th>
                            <th style="width:180px">板块</th>
                            <th style="width:40px">涨幅</th>
                        </tr>
                    </thead>
                    <tbody id="limit44"></tbody>
                </table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="history-44" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">状态</th>
                            <th style="width:180x">板块</th>
                            <th style="width:40px">昨日</th>
                            <th style="width:40px">实时</th>
                        </tr>
                    </thead>
                    <tbody id="history44"></tbody>
                </table>
            </div>
        </div>
        <!-- <div class="table-one" style="float:left;width:2px;height:100%;overflow:auto;"></div> -->
        <div class="table-one" style="float:left;width:20%;height:100%;overflow:auto;">
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit-5" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">涨停时间</th>
                            <th style="width:28px">状态</th>
                            <th style="width:98px">涨停原因</th>
                            <th style="width:60px">成交额</th>
                        </tr>
                    </thead>
                    <tbody id="limit5"></tbody>
                </table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="limit-55" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">状态</th>
                            <th style="width:180px">板块</th>
                            <th style="width:40px">涨幅</th>
                        </tr>
                    </thead>
                    <tbody id="limit55"></tbody>
                </table>
            </div>
            <div class="table-one" style="float:left;width:100%;height:30%;overflow:auto;">
                <table id="history-55" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:58px">状态</th>
                            <th style="width:180x">板块</th>
                            <th style="width:40px">昨日</th>
                            <th style="width:40px">实时</th>
                        </tr>
                    </thead>
                    <tbody id="history55"></tbody>
                </table>
            </div>

        </div>
        <!-- <div class="table-one" style="float:left;width:2px;height:100%;overflow:auto;"></div> -->
        <!-- <div class="table-one" style="float:left;width:364px;height:100%;overflow:auto;">
            <div class="table-one" style="float:left;width:100%;height:100%;overflow:auto;">
                <table id="broke-now" cellspacing="0">
                    <thead>
                        <tr>
                            <th  style="width:68px">股票名称</th>
                            <th  style="width:40px">涨幅</th>
                            <th  style="width:180px">板块</th>
                            <th  style="width:60px">成交额</th>
                        </tr>
                    </thead>
                    <tbody id="broke"></tbody>
                </table>
            </div>
        </div> -->
        <!-- <div class="table-one" style="float:left;width:2px;height:100%;overflow:auto;">
        </div> -->
        <!-- <div class="table-one" style="float:left;width:384px;height:100%;overflow:auto;">
            <div class="table-one" style="float:left;width:100%;height:100%;overflow:auto;">
                <table id="broke-history-id" cellspacing="0">
                    <thead>
                        <tr>
                            <th  style="width:68px">股票名称</th>
                            <th  style="width:40px">涨幅</th>
                            <th  style="width:180px">板块</th>
                            <th  style="width:60px">成交额</th>
                            <th  style="width:40px">实时</th>
                        </tr>
                    </thead>
                    <tbody id="broke-history"></tbody>
                </table>
            </div>
        </div> -->
        <!-- <div class="table-one" style="float:left;width:2px;height:100%;overflow:auto;"></div> -->
        <div class="table-one" style="float:left;width:384px;height:100%;overflow:auto;">
            <div class="table-one" style="float:left;width:100%;height:100%;overflow:auto;">
                <table id="history-all-four-id" cellspacing="0">
                    <thead>
                        <tr>
                            <th style="width:68px">股票名称</th>
                            <th style="width:82px">状态</th>
                            <th style="width:180x">板块</th>
                            <th style="width:40px">昨日</th>
                            <th style="width:40px">实时</th>
                        </tr>
                    </thead>
                    <tbody id="history-all-four"></tbody>
                </table>
            </div>

        </div>
    </div>
</body>


<!-- 表格排序 -->
<script type="text/javascript">
    $(function () {
        $("#limit-1").tablesorter();
        $("#limit-2").tablesorter();
        $("#limit-3").tablesorter();
        $("#limit-4").tablesorter();
        $("#limit-5").tablesorter();
        $("#limit-11").tablesorter();
        $("#limit-22").tablesorter();
        $("#limit-33").tablesorter();
        $("#limit-44").tablesorter();
        $("#limit-55").tablesorter();
        $("#history-33").tablesorter();
        $("#history-44").tablesorter();
        $("#history-55").tablesorter();
        $("#broke-now").tablesorter();
        $("#broke-history-id").tablesorter();
        $("#history-all-four-id").tablesorter();
    });
</script>
<!-- 回调函数 -->
<script type="text/javascript">
    function history_all_four(data) {
        var stocks55_ = new Array()
        stocks55 = stocks55_
        for (i = 0; i < data.length; i++) {
            stocks55.push(data[i][0])
        }
        if (stocks55.length > 0) {
            return { 'stock': stocks55, 'data': data }
            // get_rise_data_update(stocks55, data, 'history-all-four', '历史未涨停的四板及以上个股')
        }
    }
    function history_55(data) {
        var stocks55_ = new Array()
        stocks55 = stocks55_
        for (i = 0; i < data.length; i++) {
            stocks55.push(data[i][0])
        }
        if (stocks55.length > 0) {
            codes_rise(stocks55, data, 'history55', '历史未涨停的四板个股', set_table2_history)
        } else {
            set_table2_history(data, 'history55', '历史未涨停的四板个股', null)
        }
    }

    function history_44(data) {
        var stocks44_ = new Array()
        stocks44 = stocks44_
        for (i = 0; i < data.length; i++) {
            stocks44.push(data[i][0])
        }
        if (stocks44.length > 0) {
            codes_rise(stocks44, data, 'history44', '历史未涨停的三板个股', set_table2_history)
            // get_rise_data_update(stocks44, data, 'history44', '历史未涨停的三板个股')
        } else {
            set_table2_history(data, 'history44', '历史未涨停的三板个股', null)
        }
    }

    function history_33(data) {
        var stocks33_ = new Array()
        stocks33 = stocks33_
        for (i = 0; i < data.length; i++) {
            stocks33.push(data[i][0])
        }
        if (stocks33.length > 0) {
            codes_rise(stocks33, data, 'history33', '历史未涨停的二板个股', set_table2_history)
            // get_rise_data_update(stocks33, data, 'history33', '历史未涨停的二板个股')
        } else {
            set_table2_history(data, 'history33', '历史未涨停的二板个股', null)
        }
    }

    // 历史炸板
    function history_broke(data, id, caption) {
        var stocks = new Array()
        for (i = 0; i < data.length; i++) {
            stocks.push(data[i][0])
        }
        // if (stocks33.length > 0) {
        codes_rise(stocks, data, id, caption, set_table_broke)
        // get_rise_data_update_broke_history(stocks, data, 'broke-history', '昨日炸板个股')
        // }
    }
    // 历史昨日炸板
    function history_last_broke(data, id, caption) {
        var stocks = new Array()
        for (i = 0; i < data.length; i++) {
            stocks.push(data[i][0])
        }
        // if (stocks33.length > 0) {
        codes_rise(stocks, data, id, caption, set_table_broke_history)
        // get_rise_data_update_broke_history(stocks, data, 'broke-history', '昨日炸板个股')
        // }
    }
    // 炸板
    function now_broke(data) {
        var stocks = new Array()
        for (i = 0; i < data.length; i++) {
            stocks.push(data[i][0])
        }
        // if (stocks33.length > 0) {
        get_rise_data_update_broke_history(stocks, data, 'broke', '炸板')
        // }
    }
</script>

<!-- 日期事件 -->
<script type="text/javascript">
    // 左箭头回调函数
    function οnclick_to_left() {
        clearInterval(ID_THREAD)
        dates = document.getElementById("meeting").value
        console.log(dates);
        data = all_data//获取历史日期
        _indexof = data.indexOf(dates, 0) - 1 //匹配索引
        if (-1 == _indexof) {
            return
        }
        document.getElementById("meeting").value = data[_indexof] //设置日期

        show_form(data[_indexof])
        _indexof = _indexof - 1
        fourBoardStocksYesterdayHistory1(data[_indexof], 'history55', '历史未涨停的四板个股', history_55);
        threeBoardStocksYesterdayHistory(data[_indexof], 'history44', '历史未涨停的三板个股', history_44);
        twoBoardStocksYesterdayHistory(data[_indexof], 'history33', '历史未涨停的二板个股', history_33)
        limit_broke_history(data[_indexof], 'broke-history', '昨日炸板个股', history_last_broke)
        codes_rise(stock, data_all_four, 'history-all-four', '历史未涨停的四板及以上个股', set_table2_history)
        limit_broke_history(data[_indexof + 1], 'broke', '炸板', history_broke)
    }

    // 右箭头回调函数
    function οnclick_to_right() {
        clearInterval(ID_THREAD)
        dates = document.getElementById("meeting").value
        console.log(dates);
        data = all_data//获取历史日期
        _indexof = data.indexOf(dates, 0) + 1 //匹配索引
        if (data.length == _indexof) {
            return
        }
        document.getElementById("meeting").value = data[_indexof] //设置日期
        //判断是否是最后一个交易日
        if (data.length == _indexof + 1) {
            run()
        } else {
            show_form(data[_indexof])
        }
        _indexof = _indexof - 1
        fourBoardStocksYesterdayHistory1(data[_indexof], 'history55', '历史未涨停的四板个股', history_55);
        threeBoardStocksYesterdayHistory(data[_indexof], 'history44', '历史未涨停的三板个股', history_44);
        twoBoardStocksYesterdayHistory(data[_indexof], 'history33', '历史未涨停的二板个股', history_33)
        limit_broke_history(data[_indexof], 'broke-history', '昨日炸板个股', history_last_broke)
        codes_rise(stock, data_all_four, 'history-all-four', '历史未涨停的四板及以上个股', set_table2_history)
        limit_broke_history(data[_indexof + 1], 'broke', '炸板', history_broke)

    }

    // 获取历史日期
    function get_history_date() {
        var m_data = []
        $.ajax({
            url: '/get_history_date',
            // data: {data: codes},
            type: 'GET',
            async: false, //异步加载
            dataType: 'json',
            // contentType: 'application/json; charset=UTF-8',
            success: function (data) {
                m_data = data;
                console.log(data);
            },
            error: function (msg) {
                console.log(msg);
            }
        })
        return m_data;
    };

    function show_form(date) {//date 日期
        oneStocksHistory(date, 'limit1', '一板')
        oneStocksYesterdayHistory(date, 'limit2', '二板')
        oneBoardStocksYesterdayHistory(date, 'limit22', '未涨停的昨日一板个股')
        twoStocksYesterdayHistory(date, 'limit3', '三板')
        twoBoardStocksYesterdayHistory(date, 'limit33', '未涨停的昨日二板个股')
        threeStocksYesterdayHistory(date, 'limit4', '四板')
        threeBoardStocksYesterdayHistory(date, 'limit44', '未涨停的昨日三板个股')
        fourStocksYesterdayHistory(date, 'limit5', '更高')
        fourBoardStocksYesterdayHistory1(date, 'limit55', '未涨停的昨日四板及以上个股')
    }

    function upperCase(x) {
        clearInterval(ID_THREAD)
        var dates = document.getElementById(x).value //获取选择的日期
        show_form(dates)
        data = all_data
        _indexof = data.indexOf(dates, 0) - 1
        _stocks55 = get_limit2_data_history('fourBoardStocksYesterdayHistory', data[_indexof], 'history55', '历史未涨停的四板个股', history_55)
        _stocks44 = get_limit2_data_history('threeBoardStocksYesterdayHistory', data[_indexof], 'history44', '历史未涨停的三板个股', history_44)
        _stocks33 = get_limit2_data_history('twoBoardStocksYesterdayHistory', data[_indexof], 'history33', '历史未涨停的二板个股', history_33)
        get_limit2_data_history('limit_broke_history', data[_indexof], 'broke-history', '昨日炸板个股', history_broke)
    }

    //获取历史未涨停的四板及以上个股
    function get_stocks(dates) {
        for (var i = 1; i < 22; i++) {
            // _data = get_limit2_data_history('fourBoardStocksYesterdayHistory', dates[dates.length - i], '', '', get_stocks_callback)
            _data = fourBoardStocksYesterdayHistory(dates[dates.length - i]);

        }
    }

    function fourBoardStocksYesterdayHistoryCallback(data) {
        if (data.length > 0) {
            if (data.length > 0) {
                __data = history_all_four(data)
                stock = stock.concat(__data['stock'])
                data_all_four = data_all_four.concat(__data['data'])
            }
        }
    }

    // 东方财富股票实时数据
    function codes_rise(stocks, _data, id, caption, callback) {
        if (!stocks || stocks == false) {
            return null;
        }
        var m_data = []

        let stock = '';
        // console.log('stocks='+stocks);
        //获取股票代码

        for (let i = 0; i < stocks.length; i++) {
            // if(stocks[i]=='000721'){
            //    console.log(stocks[i]);
            //    status = 1;
            // }
            if (stocks[i].slice(0, 1) == 6) {
                // stocks[i]='1.'+stocks[i]+'%2C';
                stock = stock + '1.' + stocks[i] + '%2C';
            } else {
                // stocks[i]='0.'+stocks[i]+'%2C';
                stock = stock + '0.' + stocks[i] + '%2C';
            }
        }

        $.ajax({
            url: 'https://push2.eastmoney.com/api/qt/ulist/get?fltt=1&invt=2&cb=jQuery351010838368397660503_1675494557241&fields=f3%2Cf12&secids=' + stock + '&ut=fa5fd1943c7b386f172d6893dbfba10b&pn=1&np=1&pz=20&wbp2u=%7C0%7C0%7C0%7Cweb&_=1675494557502',
            type: 'POST',
            async: true,
            dataType: 'text',
            // contentType: 'application/json; charset=UTF-8',
            success: function (data) {
                var regex3 = /\{.*\}/;  // {} 花括号，大括号
                // res.send(JSON.stringify(body.match(regex3)));// JSON格式化
                data = data.match(regex3)[0];
                // console.log(data);
                var data = eval('(' + data + ')')['data']['diff'];//json格式化数据
                //处理数据
                let json = {};
                for (let i = 0; i < data.length; i++) {
                    let float = (data[i]['f3'] / 100).toFixed(2);
                    json[data[i]['f12']] = float;
                }
                callback(_data, id, caption, json);
            },
            error: function (msg) {
                console.log(msg);
            }
        })

    };

    function get_stocks_callback(data) {
        if (data.length > 0) {
            _data = history_all_four(data)
            stock = stock.concat(_data['stock'])
            data_all_four = data_all_four.concat(_data['data'])
        }
        update_all_four_from(data_all_four)
    }

    function update_all_four_from(data) {
        get_rise_data_update(stock, data, 'history-all-four', '历史未涨停的四板及以上个股')
    }

</script>

<script type="text/javascript">
    var ID_THREAD = -1; //循环线程
    var all_theme = []; //题材数组
    var stocks55, stocks44, stocks33 = new Array();
    var stock = [], data_all_four = [], all_data = [];

    $(document).ready(function () {
        onload();
    });

    // 获取最近几个交易日日期
    function history_date_eastmoney() {
        var m_data = []
        $.ajax({
            url: 'https://push2his.eastmoney.com/api/qt/stock/kline/get?cb=jQuery351020143393668275844_1674273725401&secid=0.000001&ut=fa5fd1943c7b386f172d6893dbfba10b&fields1=f1&fields2=f51&klt=101&fqt=1&end=20500101&lmt=1000000&_=1674273725455 ',
            type: 'GET',
            async: true,
            dataType: 'text',
            // contentType: 'application/json; charset=UTF-8',
            success: function (data) {
                // var data = eval('(' + data + ')')['klines'];
                // console.log(data);
                var regex3 = /\{\"code\".*\]\}/;  // {} 花括号，大括号
                data = data.match(regex3)[0]
                data = JSON.parse(data)["klines"]//JSON格式化
                // console.log(data);
                all_data = data
                next(data);
            },
            error: function (msg) {
                console.log(msg);
            }
        })

    };
    //加载页面
    function onload() {
        let tb = document.getElementById('table'); //设置字体大小
        tb.style.fontSize = 1 + 'px'
        dates = history_date_eastmoney()
        // stocksHistory('2023-02-06')

    }
    function next(data) {
        var dates = data;
        // var regex3 = /\{\"[code].*\}/;  // {} 花括号，大括号
        // console.log(String(dates).match(regex3)); // ["xxxx"]

        //获取现在日期
        var date = new Date();
        const formatDate = (date) => {
            let formatted_date = date.getFullYear() + "-" + checkDay((date.getMonth() + 1)) + "-" + checkDay(date.getDate())
            return formatted_date;
        }
        console.log(formatDate(date));
        document.getElementById("meeting").value = dates[dates.length - 1] //设置日期

        get_stocks(dates)// 获取历史四板以上股票代码3
        run(data);
        ID_THREAD = auto_update(run)

    }
    function run(dates = all_data) {
        get_daily_limit_performance1('limit1', '一板');
        get_daily_limit_performance2('limit2', '二板');
        get_daily_notlimit_performance1('limit22', '未涨停的昨日一板个股');
        threePlate('limit3', '三板');
        twoBoardStocksYesterday('limit33', '未涨停的昨日二板个股');
        fourPlate('limit4', '四板');
        threeBoardStocksYesterday('limit44', '未涨停的昨日三板个股');
        fivePlate('limit5', '5板或更高');
        fourBoardStocksYesterday('limit55', '未涨停的昨日四板个股');

        fourBoardStocksYesterdayHistory1(dates[dates.length - 2], 'history55', '历史未涨停的四板个股', history_55);
        threeBoardStocksYesterdayHistory(dates[dates.length - 2], 'history44', '历史未涨停的三板个股', history_44);
        twoBoardStocksYesterdayHistory(dates[dates.length - 2], 'history33', '历史未涨停的二板个股', history_33)
        limit_broke_history(dates[dates.length - 2], 'broke-history', '昨日炸板个股', history_last_broke)
        codes_rise(stock, data_all_four, 'history-all-four', '历史未涨停的四板及以上个股', set_table2_history)
        get_broke()//炸板
    }

    function set_table1(data, id, caption) {
        all_theme = [];
        var m_html = ""
        var m_list = data
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else
                m_html += "<tr class=\"cur\">"
            if (m_list[i_row][16] == 1) {
                if (m_list[i_row][0].slice(0, 1) == '3' || m_list[i_row][0].slice(0, 3) == '688') {
                    m_html += "<td class=\"red gbnews gre td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
                } else {
                    m_html += "<td class=\"gbnews gre td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
                }
            } else {
                if (m_list[i_row][0].slice(0, 1) == '3' || m_list[i_row][0].slice(0, 3) == '688') {
                    m_html += "<td class=\"red td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
                } else
                    m_html += "<td class=\"td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>"
            }
            m_html += "<td>" + format_date(new Date(parseInt(m_list[i_row][4]) * 1000)) + "</td>"
            m_html += "<td>" + m_list[i_row][15] + "</td>"
            m_html += "<td>" + m_list[i_row][5] + "</td>"
            m_html += "<td>" + format_money(m_list[i_row][11]) + "</td>"
            m_html += "</tr>"
        }
        var tb = document.getElementById(id); //获取表格的dom节点
        var caption = "<caption align=\"top\">" + caption + "-" + m_list.length + "</caption>"
        tb.innerHTML = m_html
        $("#limit-1").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#limit-2").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#limit-3").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#limit-4").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#limit-5").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
    }


    function set_table2(data, id, caption) {
        all_theme = [];
        var m_html = ""
        var m_th = ""
        var m_list = data
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else
                m_html += "<tr class=\"cur\">"
            if (m_list[i_row][16] == 1) {
                if (m_list[i_row][0].slice(0, 1) == '3' || m_list[i_row][0].slice(0, 3) == '688') {
                    m_html += "<td class=\"red gbnews gre td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
                } else {
                    m_html += "<td class=\"gbnews gre td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
                }
            } else {
                if (m_list[i_row][0].slice(0, 1) == '3' || m_list[i_row][0].slice(0, 3) == '688') {
                    m_html += "<td class=\"red td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
                } else
                    m_html += "<td class=\"td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>"
            }
            m_html += "<td>" + m_list[i_row][15] + "</td>"
            m_html += "<td>" + m_list[i_row][6] + "</td>"
            if (m_list[i_row][5] < 0) {
                m_html += "<td class=\"gbnews gre\">" + m_list[i_row][5] + "</td>" //设置涨幅的颜色
            } else {
                m_html += "<td class=\"red\">" + m_list[i_row][5] + "</td>"
            }

            m_html += "</tr>"
        }
        var tb = document.getElementById(id); //获取表格的dom节点
        var caption = ""
        if (m_list.length == 0) {
            tb.innerHTML = caption + m_th + ''
        } else
            tb.innerHTML = caption + m_th + m_html

        $("#limit-11").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#limit-22").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#limit-33").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#limit-44").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#limit-55").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
    }

    function set_table2_history(data, id, caption, limit) {
        all_theme = [];
        var m_html = ""
        var m_th = ""
        var m_list = data
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else {
                m_html += "<tr class=\"cur\">"
            }
            if (m_list[i_row][16] == 1) {
                m_html += "<td class=\"gbnews gre td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
            } else {
                m_html += "<td class=\"td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>"
            }
            m_html += "<td>" + m_list[i_row][15] + "</td>"
            m_html += "<td>" + m_list[i_row][6] + "</td>"
            if (m_list[i_row][5] < 0) {
                m_html += "<td class=\"gbnews gre\">" + m_list[i_row][5] + "</td>" //设置涨幅的颜色
            } else {
                m_html += "<td class=\"red\">" + m_list[i_row][5] + "</td>"
            }
            if (limit[m_list[i_row][0]] < 0) {
                m_html += "<td class=\"gbnews gre\">" + limit[m_list[i_row][0]] + "</td>" //设置股票名称的颜色
            } else {
                m_html += "<td class=\"red\">" + limit[m_list[i_row][0]] + "</td>"
            }
            m_html += "</tr>"
        }
        var tb = document.getElementById(id); //获取表格的dom节点
        var caption = ""
        //m_list 为空则清空表格
        if (m_list.length == 0) {
            tb.innerHTML = caption + m_th + ''
        } else
            tb.innerHTML = caption + m_th + m_html

        $("#history-33").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#history-44").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题
        $("#history-55").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题    
        $("#history-all-four-id").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题    
    }
    // 炸板表格
    function set_table_broke(data) {
        all_theme = [];
        var m_html = ""
        var m_th = ""
        var m_list = data
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else
                m_html += "<tr class=\"cur\">"

            if (m_list[i_row][0].slice(0, 1) == '3' || m_list[i_row][0].slice(0, 3) == '688') {
                m_html += "<td class=\"red  td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
            } else {
                m_html += "<td class=\" td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
            }
            // 设置颜色
            if (m_list[i_row][4] > 0) {
                m_html += "<td class=\"red\">" + m_list[i_row][4] + "</td>"
            } else
                m_html += "<td class=\"gre\">" + m_list[i_row][4] + "</td>"
            m_html += "<td>" + m_list[i_row][11] + "</td>"
            m_html += "<td>" + format_money(m_list[i_row][13]) + "</td>"
            m_html += "</tr>"
        }
        var tb = document.getElementById("broke"); //获取表格的dom节点
        // var caption = "<caption align=\"top\">炸板-" + m_list.length + "</caption>"
        tb.innerHTML = m_th + m_html
        $("#broke-now").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题   
    }

    // 历史炸板表格
    function set_table_broke_history(data, id, caption, limit) {
        all_theme = [];
        var m_html = ""
        var m_th = ""

        var m_list = data
        for (var i_row = 0; i_row < m_list.length; i_row++) {
            if (i_row % 2 == 0) {
                m_html += "<tr>"
            } else {
                m_html += "<tr class=\"cur\">"
            }
            if (m_list[i_row][0].slice(0, 1) == '3' || m_list[i_row][0].slice(0, 3) == '688') {
                m_html += "<td class=\"red  td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
            } else {
                m_html += "<td class=\" td1 over-chart\" data-name=\"" + m_list[i_row][1] + "\" data-sid=\"" + m_list[i_row][0] + "\" data-ct=\"big\">" + m_list[i_row][1] + "</td>" //设置股票的颜色
            }

            // 设置涨幅颜色
            if (m_list[i_row][4] > 0) {
                m_html += "<td class=\"red\">" + m_list[i_row][4] + "</td>"
            } else
                m_html += "<td class=\"gre\">" + m_list[i_row][4] + "</td>"
            m_html += "<td>" + m_list[i_row][11] + "</td>"
            m_html += "<td>" + format_money(m_list[i_row][13]) + "</td>"

            if (limit[m_list[i_row][0]] < 0) {
                m_html += "<td class=\"gbnews gre\">" + limit[m_list[i_row][0]] + "</td>" //设置股票名称的颜色
            } else {
                m_html += "<td class=\"red\">" + limit[m_list[i_row][0]] + "</td>"
            }
            m_html += "</tr>"
        }
        var tb = document.getElementById(id); //获取表格的dom节点
        // var caption = "<caption align=\"top\">" + caption + "-" + m_list.length + "</caption>"
        //m_list 为空则清空表格
        if (m_list.length == 0) {
            tb.innerHTML = m_th + ''
        } else
            tb.innerHTML = m_th + m_html

        $("#broke-history-id").trigger("update");//ajax动态生成table时，jquery的tablesorter失效问题   
    }

</script>

</html>